package com.gw.jpa.service.impl;

import com.gw.jpa.entity.Dept;
import com.gw.jpa.repository.DeptRepository;
import com.gw.jpa.service.DeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class DeptServiceImpl implements DeptService {
    @Autowired
    DeptRepository deptRepository;
    @Override
    public List<Dept> getDeptJquery() {
        return deptRepository.findAll();
    }

    @Override
    public Dept getDept(Integer deptno) {
        return deptRepository.findById(deptno).get();
    }
}
